package com.sugar.psych.assessment.module.business.controller.app.usermedal;

import com.sugar.psych.assessment.framework.common.pojo.CommonResult;
import com.sugar.psych.assessment.framework.security.core.util.SecurityFrameworkUtils;
import com.sugar.psych.assessment.module.business.controller.admin.usermedal.vo.UserMedalRespVO;
import com.sugar.psych.assessment.module.business.service.usermedal.UserMedalService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

import static com.sugar.psych.assessment.framework.common.pojo.CommonResult.successApp;

@Tag(name = "APP - 用户获得勋章信息")
@RestController
@RequestMapping("/psych/user-medal")
@Validated
public class AppUserMedalController {

    @Resource
    private UserMedalService userMedalService;

    @GetMapping("/get")
    @Operation(summary = "获得用户获得勋章信息")
    public CommonResult<List<UserMedalRespVO>> getUserAllGetMedal() {
        return successApp(userMedalService.getUserAllGetMedal(SecurityFrameworkUtils.getLoginUserId()));
    }
}